export default {
  formatDate (datetime) {
    const date = new Date(datetime)// 时间戳为10位需*1000，时间戳为13位的话不需乘1000
    const year = date.getFullYear()
    const month = ('0' + (date.getMonth() + 1)).slice(-2)
    const sdate = ('0' + date.getDate()).slice(-2)
    const hour = ('0' + date.getHours()).slice(-2)
    const minute = ('0' + date.getMinutes()).slice(-2)
    const second = ('0' + date.getSeconds()).slice(-2)
    // 拼接返回
    return year + '-' + month + '-' + sdate + ' ' + hour + ':' + minute + ':' + second
  }
}
